package com.finance.view;

import java.io.Serializable;
import javax.faces.context.FacesContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

/**
 *
 * @author Visual556
 */
@Controller
@Scope("session")
public class UserAccountSession implements Serializable {

    private String username;

    public UserAccountSession() {
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String logout() {
        FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("username", null);
        FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("userAccountEnum", null);
        username = null;
        return "success";
    }
}
